// 加载环境变量
require('dotenv').config();

module.exports = {
  // 数据库配置
  database: {
    host: process.env.DB_HOST,
    port: parseInt(process.env.DB_PORT),
    user: process.env.DB_USER,
    password: process.env.DB_PASSWORD,
    database: process.env.DB_NAME,
    waitForConnections: true,
    connectionLimit: 10,
    queueLimit: 0
  },

  // 微信小程序配置
  wechat: {
    appId: process.env.WX_APP_ID,
    appSecret: process.env.WX_APP_SECRET,
    mchId: process.env.WX_MCH_ID,
    apiKey: process.env.WX_API_KEY,
    notifyUrl: process.env.NOTIFY_URL
  },

  // 服务器配置
  server: {
    port: parseInt(process.env.PORT) || 3000,
    env: process.env.NODE_ENV || 'development'
  }
};
